<template>
	<view>
		<!-- <homePage v-if="PageCur=='homePage'"></homePage>
		<myPage v-if="PageCur=='myPage'"></myPage> -->
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @tap="goToHomePage">
				<view class='cuIcon-cu-image'>
					<image :src="'../static/tabar/' + [PageCur=='homePage'?'notice_1':'notice_2'] + '.png'"></image>
				</view>
				<view :class="PageCur=='homePage'?'text-green':'text-gray'">首页</view>
			</view>
			<view class="action text-gray add-action" @tap="goToAdd">
				<button class="cu-btn cuIcon-add bg-green shadow"></button>
				发布
			</view>
			<!-- <view class="action" @click="NavChange" data-cur="myPage"> -->
			<view class="action" @tap="goToMyPage">
				<view class='cuIcon-cu-image'>
					<image :src="'../static/tabar/' + [PageCur=='myPage'?'my_1':'my_2'] + '.png'"></image>
				</view>
				<view :class="PageCur=='myPage'?'text-green':'text-gray'">我的</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				PageCur: 'homePage'
			}
		},
		methods: {
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
				console.log(e.currentTarget.dataset.cur)
			},
			goToAdd() {
				uni.navigateTo({
					url: "/pages/add/index"
				})
			},
			goToMyPage() {
				this.PageCur = "myPage";
				uni.navigateTo({				
					url: "/pages/my/index",
				})
			},
			goToHomePage() {
				//this.PageCur = "homePage";
				uni.navigateTo({				
					url: "/pages/home/index",
				})
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
